<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>投票结果 - 简洁现代风格</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }
        
        :root {
            --primary: #4e54c8;
            --secondary: #8f94fb;
            --accent: #ff6b6b;
            --light: #f8f9fa;
            --dark: #343a40;
            --success: #28a745;
            --warning: #ffc107;
            --info: #17a2b8;
            --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }
        
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
            min-height: 100vh;
            padding: 20px;
            color: var(--dark);
            line-height: 1.6;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        
        .container {
            max-width: 800px;
            width: 100%;
            margin: 0 auto;
            padding: 30px;
            position: relative;
            z-index: 1;
        }
        
        /* 装饰元素 */
        .decoration {
            position: absolute;
            z-index: 0;
        }
        
        .decoration.circle-1 {
            width: 200px;
            height: 200px;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(143, 148, 251, 0.15), rgba(78, 84, 200, 0.1));
            top: 10%;
            right: 10%;
        }
        
        .decoration.circle-2 {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 107, 107, 0.05));
            bottom: 15%;
            left: 10%;
        }
        
        .decoration.triangle {
            width: 0;
            height: 0;
            border-left: 80px solid transparent;
            border-right: 80px solid transparent;
            border-bottom: 140px solid rgba(40, 167, 69, 0.08);
            transform: rotate(45deg);
            top: 20%;
            left: 5%;
        }
        
        .header {
            text-align: center;
            margin-bottom: 40px;
            position: relative;
            z-index: 2;
        }
        
        h1 {
            font-size: 2.5rem;
            margin-bottom: 15px;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 2px 4px rgba(0,0,0,0.05);
            padding-bottom: 15px;
            position: relative;
        }
        
        h1::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 4px;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            border-radius: 2px;
        }
        
        .result-card {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 16px;
            box-shadow: var(--shadow);
            overflow: hidden;
            transition: var(--transition);
            margin-bottom: 30px;
            position: relative;
            z-index: 2;
            backdrop-filter: blur(5px);
            border: 1px solid rgba(255, 255, 255, 0.3);
        }
        
        .result-header {
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            color: white;
            padding: 20px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        
        .result-header::after {
            content: '';
            position: absolute;
            top: -50px;
            right: -50px;
            width: 150px;
            height: 150px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
        }
        
        .result-body {
            padding: 30px;
        }
        
        ul {
            list-style: none;
            margin-top: 20px;
        }
        
        li {
            padding: 20px;
            margin-bottom: 15px;
            border-radius: 12px;
            background: #f8f9ff;
            position: relative;
            overflow: hidden;
            border: 1px solid #e9ecef;
            transition: var(--transition);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        li:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            border-color: var(--primary);
        }
        
        .choice-text {
            font-size: 1.1rem;
            font-weight: 500;
            display: flex;
            align-items: center;
        }
        
        .choice-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 15px;
            color: white;
            font-weight: bold;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
        }
        
        .vote-count {
            font-weight: 700;
            color: var(--primary);
            font-size: 1.2rem;
            background: rgba(143, 148, 251, 0.1);
            padding: 5px 15px;
            border-radius: 20px;
            min-width: 100px;
            text-align: center;
        }
        
        .vote-count::before {
            content: '票数: ';
            font-weight: normal;
            font-size: 0.9rem;
            opacity: 0.7;
        }
        
        .action-links {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 30px;
            position: relative;
            z-index: 2;
        }
        
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 14px 30px;
            border-radius: 12px;
            text-decoration: none;
            font-weight: 600;
            font-size: 1.1rem;
            transition: var(--transition);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            position: relative;
            overflow: hidden;
            z-index: 1;
        }
        
        .btn-vote {
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            color: white;
        }
        
        .btn-vote::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, var(--secondary), var(--primary));
            opacity: 0;
            transition: var(--transition);
            z-index: -1;
        }
        
        .btn-vote:hover {
            transform: translateY(-3px);
            box-shadow: 0 7px 15px rgba(78, 84, 200, 0.4);
        }
        
        .btn-vote:hover::after {
            opacity: 1;
        }
        
        .btn-home {
            background: white;
            color: var(--primary);
            border: 2px solid var(--primary);
        }
        
        .btn-home:hover {
            background: #f0f2ff;
            transform: translateY(-3px);
        }
        
        .footer {
            text-align: center;
            margin-top: 40px;
            color: #6c757d;
            font-size: 0.9rem;
            padding: 20px;
            position: relative;
            z-index: 2;
        }
        
        .summary {
            background: rgba(255, 255, 255, 0.7);
            border-radius: 16px;
            padding: 20px;
            margin-top: 30px;
            text-align: center;
            backdrop-filter: blur(5px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            box-shadow: var(--shadow);
        }
        
        .summary-title {
            font-size: 1.2rem;
            color: var(--primary);
            margin-bottom: 15px;
            font-weight: 600;
        }
        
        .stats {
            display: flex;
            justify-content: space-around;
            margin-top: 15px;
        }
        
        .stat-item {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        .stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 5px;
        }
        
        .stat-label {
            font-size: 0.9rem;
            color: #6c757d;
        }
        
        @media (max-width: 600px) {
            .container {
                padding: 20px 15px;
            }
            
            h1 {
                font-size: 2rem;
            }
            
            li {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
            }
            
            .vote-count {
                align-self: flex-end;
            }
            
            .action-links {
                flex-direction: column;
                gap: 15px;
            }
            
            .stats {
                flex-direction: column;
                gap: 15px;
            }
        }
        
        /* 动画效果 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .result-card, .summary, .action-links {
            animation: fadeIn 0.6s ease-out forwards;
        }
        
        .result-card { animation-delay: 0.1s; }
        .summary { animation-delay: 0.3s; }
        .action-links { animation-delay: 0.5s; }
    </style>
</head>
<body>
    <!-- 装饰元素 -->
    <div class="decoration circle-1"></div>
    <div class="decoration circle-2"></div>
    <div class="decoration triangle"></div>
    
    <div class="container">
        <div class="header">
            <h1>{{ question.question_text }}</h1>
        </div>
        
        <div class="result-card">
            <div class="result-header">
                <h2>投票结果统计</h2>
            </div>
            
            <div class="result-body">
                <!-- 保持原始模板结构不变 -->
                <ul>
                    {% for choice in question.choice_set.all %}
                        <li>
                            <div class="choice-text">
                                <div class="choice-icon">{{ forloop.counter }}</div>
                                {{ choice.choice_text }}
                            </div>
                            <div class="vote-count">
                                {{ choice.votes }} vote{{ choice.votes|pluralize }}
                            </div>
                        </li>
                    {% endfor %}
                </ul>
            </div>
        </div>
        
        <div class="summary">
            <div class="summary-title">投票摘要信息</div>
            <div class="stats">
                <div class="stat-item">
                    <div class="stat-value">{{ question.choice_set.count }}</div>
                    <div class="stat-label">选项数量</div>
                </div>
                <div class="stat-item">
                    <div class="stat-value">{{ total_votes }}</div>
                    <div class="stat-label">总投票数</div>
                </div>
                <div class="stat-item">
                    <div class="stat-value">{{ max_votes }}</div>
                    <div class="stat-label">最高票数</div>
                </div>
            </div>
        </div>
        
        <div class="action-links">
            <!-- 保持原始链接不变 -->
            <a href="{% url 'polls:detail' question.id %}" class="btn btn-vote">投票?</a>
            <a href="{% url 'polls:index' %}" class="btn btn-home">返回投票首页</a>
        </div>
        
        <div class="footer">
            <p>© 2025 投票系统 | 感谢您的参与</p>
        </div>
    </div>
    
    <script>
        // 简单的动画效果增强
        document.addEventListener('DOMContentLoaded', function() {
            // 为每个列表项添加动画延迟
            const listItems = document.querySelectorAll('li');
            listItems.forEach((item, index) => {
                item.style.animation = `fadeIn 0.5s ease-out ${index * 0.1}s forwards`;
                item.style.opacity = '0';
            });
            
            // 添加悬停效果
            const voteButtons = document.querySelectorAll('.btn');
            voteButtons.forEach(button => {
                button.addEventListener('mouseenter', function() {
                    this.style.transform = 'translateY(-3px)';
                });
                
                button.addEventListener('mouseleave', function() {
                    this.style.transform = 'translateY(0)';
                });
            });
        });
    </script>
</body>
</html>